<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示与隐藏</title>

    <style>

        .box {
            margin: 100px auto;
            position: relative;
            width: 444px;
            height: 320px;
        }

        .box img {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .box .gray {
            position: absolute;
            z-index: 1;
            display: none;
            /* visibility: hidden; */
            background: rgba(0, 0, 0, .4) url(../imgs/arr.png) no-repeat center;
            width: 100%;
            height: 100%;
        }

        .box:hover .gray {
            display: block;
            /* visibility: visible; */
        }

    </style>

</head>
<body>
    
    <div class="box">
        <div class="gray"></div>
        <img src="../imgs/bgImg.jpeg" alt="">
    </div>

</body>
</html>